<template>
  <a-form-item
    :label="props.data.config.title"
    :name="props.data.id"
    @click="handleClick"
  >
    <Add :data="props.data" />
  </a-form-item>
</template>
<script setup>
import { defineProps, computed } from "vue";
import { useFormStore } from "@/form/design-mode/store/formStore";
import { getComponent } from "@/form/common/component-market";
const formStore = useFormStore();

const props = defineProps({
  data: Object,
});
const Add = computed(()=>{
   return getComponent(props.data.type,'Add');
})
const handleClick = () => {
  formStore.setSelected(props.data.id);
};
</script>
